package com.qf.market.service;

import com.github.pagehelper.PageInfo;
import com.qf.market.dao.OrderDetailDao;
import com.qf.market.po.OrderDetail;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
public class OrderDetailServiceImpl implements OrderDetailService{
    @Resource
    OrderDetailDao orderDetailDao;

    @Override
    public PageInfo<OrderDetail> getAllOrderDetailByNum(Map params) {
        List<OrderDetail> orderDetailList=orderDetailDao.getAllOrderDetailByNum(params);
        PageInfo<OrderDetail> pageInfo = new PageInfo<OrderDetail>(orderDetailList);
        return pageInfo;
    }

    @Override
    public boolean addOrderDetail(OrderDetail orderDetail) {
        return orderDetailDao.addOrderDetail(orderDetail) > 0;
    }


    @Override
    public boolean updateOrderDetail(OrderDetail orderDetail) {

        return orderDetailDao.updateOrderDetail(orderDetail) > 0;
    }

}
